import React, { memo, useContext } from "react";
import type { ReactNode, FC } from "react";
import { Link } from "react-router-dom";
import Logo from "../../img/logo.png";
import { AuthContext } from "../../context/authContext";
interface IProps {
  children?: ReactNode;
}
const NavBar: FC<IProps> = () => {
  const { currentUser, logout } = useContext(AuthContext);
  return (
    <div className="navbar">
      <div className="container">
        <div className="logo">
          <Link to="/">
            <img src={Logo} alt="" />
          </Link>
        </div>
        <div className="links">
          <Link className="link" to="/">
            <h6>主页</h6>
          </Link>
          <Link className="link" to="/register">
            <h6>注册</h6>
          </Link>
          <Link className="link" to="/login">
            Login
          </Link>
          <span className="write">
            <Link className="link" to="/write">
              发帖
            </Link>
          </span>
        </div>
      </div>
    </div>
  );
};
export default memo(NavBar);
